﻿Public Class WizardObj
    Inherits HeroObj

#Region " additional members and properties "

    Private _powerStore As Short
    Private _maxPowerStore As Short

    Public Property PowerStore As Short
        Get
            Return _powerStore
        End Get
        Set(ByVal value As Short)
            _powerStore = value
        End Set
    End Property

    Public Property MaxPowerStore As Short
        Get
            Return _maxPowerStore
        End Get
        Set(ByVal value As Short)
            _maxPowerStore = value
        End Set
    End Property

#End Region

    Public Sub New()
        _attacks = 1
        _damage = 1
        _endurance = 3
        _luck = 0
        _maxHealth = AppConstants.D6Roll + 6
        If _maxHealth = 7 Then _maxHealth = AppConstants.D6Roll + 6 'reroll if first roll was one
        _meleeSkill = 2
        _move = 4
        _pinning = 4
        _rangedSkill = 6
        _strength = 3
        _wit = 3

        HeroClassId = eHeroClass.Wizard
        Level = 1
        CurrentHealth = _maxHealth
        Gold = 0

        _powerStore = AppConstants.D6Roll
        If _powerStore = 1 Then _powerStore = AppConstants.D6Roll 'reroll if first roll was one
        _maxPowerStore = _powerStore

        Name = GenerateName()

    End Sub

    Public Overrides Function GenerateName() As String

        Dim dieRoll As Short = AppConstants.D100Roll

        Dim name As String = String.Empty

        Select Case dieRoll
            
            Case Is < 11
                name = "Magnus"

            Case 11 To 20
                name = "Waldemar"

            Case 21 To 30
                name = "Johann"

            Case 31 To 40
                name = "Rudiger"

            Case 41 To 50
                name = "Eckhardt"

            Case 51 To 60
                name = "Albrecht"

            Case 61 To 70
                name = "Heinz"

            Case 71 To 80
                name = "Gustav"

            Case 81 To 90
                name = "Ulrich"

            Case 91 To 100
                name = "Wolfgang"

        End Select

        Return name

    End Function

End Class
